package org.journal.rest;

import org.journal.dao.RecordDao;
import org.journal.entity.RecordEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class JournalService {

	@Autowired
	private RecordDao recordDao;

	@RequestMapping(value = "/rest/getTestJournal", produces = MediaType.TEXT_PLAIN_VALUE)
	@ResponseBody
	public String getTestJournal() {

		return new String("sds");
	}

	@RequestMapping(value = "/rest/saveRecord")
	@ResponseBody
	public void saveRecord(@RequestBody RecordEntity record) {

		recordDao.save(record);

	}

}
